import React from 'react'
import { HashRouter, Route, Routes, Navigate } from 'react-router-dom'
import Login from '../views/Login/Login'
import NewsSandBox from '../views/sandBox/NewsSandBox'
import Home from '../views/sandBox/Home/Home'
import UserList from '../views/sandBox/user-manage/UserList'
import RoleList from '../views/sandBox/right-manage/RoleList'
import RightList from '../views/sandBox/right-manage/RightList'

export default function IndexRouter() {
  let auth: boolean = false
  return (
    <HashRouter>
      <Routes>
        <Route path="/login" element={<Login></Login>}></Route>
        {/* <Route path="/" children={<NewsSandBox></NewsSandBox>}></Route> */}
        <Route
          path="/*"
          element={localStorage.getItem('token') ? <NewsSandBox></NewsSandBox> : <Navigate to="/login" />}
        ></Route>
      </Routes>
    </HashRouter>
  )
}
